home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
dl_exsrc.zoo
/
getcook.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-07-03
|
627b
|
39 lines
#include <osbind.h>
/* Cookie-reading program "borrowed" from the MiNTlibs startup
code -- 6/27/94 sb */
static long getcook __PROTO((void));
static long work;
static long getcook()
{
register long *cookie;
register long key = work;
cookie = *((long **) 0x5a0L);
if (!cookie)
return 0;
else {
while (*cookie) {
if (*cookie == work) {
work = cookie[1];
return 1;
}
cookie += 2;
}
}
return 0;
}
int Getcookie( long cookie, long *value )
{
work = cookie;
if (Supexec(getcook)) {
if (value)
*value = work;
return 1;
} else return 0;
}